<div class="main layui-clear">
    <div class="wrap">
        <div class="content">
            <div class="fly-tab fly-tab-index">
                <span>
                    <a href="{:U('home/details/index')}">
                        全部
                    </a>
                    <a href="{:U('home/details/unsolved')}">
                        未结帖
                    </a>
                    <a href="{:U('home/details/solved')}">
                        已采纳
                    </a>
                    <a href="{:U('home/details/wonderful')}">
                        精帖
                    </a>
                </span>
                <form action="http://cn.bing.com/search" class="fly-search">
                    <i class="iconfont icon-sousuo">
                    </i>
                    <input class="layui-input" autocomplete="off" placeholder="搜索内容，回车跳转"
                    type="text" name="q">
                </form>
                <a href="{:U('home/index/add')}" class="layui-btn jie-add">
                    发表新帖
                </a>
            </div>
            <ul class="fly-panel fly-list fly-list-top">
                <?php foreach ($states as $row) {  ?>
                    <li class="fly-list-li">
                        <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                            <img src="__ROOT__/<?php echo $row['headface']; ?>" alt="<?php echo $row['username']; ?>">
                        </a>
                        <h2 class="fly-tip">
                            <a href="{:U('home/jie/index',array('id'=>$row['id']))}">
                                <?php echo $row['title']; ?>
                            </a>
                                <?php if(in_array('置顶', explode(',', $row['state']))){  ?>
                                    <span class="fly-tip-stick">置顶</span>
                                <?php     }  ?>
                                <?php if(in_array('精帖', explode(',', $row['state']))){  ?>
                                    <span class="fly-tip-jing">精帖</span>
                                <?php     }  ?>
                        </h2>
                        <p>
                            <span>
                                <a href="{:U('home/u/index',array('id'=>$row['uid']))}">
                                    <?php echo $row['username']; ?>
                                </a>
                            </span>
                            <span>
                                <?php echo date('Y-m-d H:i:s',$row['create_time']) ?>
                            </span>
                            <span>
                                <?php echo $row['cname'] ?>
                            </span>
                            <span class="fly-list-hint">
                                <i class="iconfont" title="回答">
                                    
                                </i>
                                <?php echo $row['answer_num']; ?>
                                <i class="iconfont" title="人气">
                                    
                                </i>
                                <?php echo $row['view_num'] ?>
                            </span>
                        </p>
                    </li>
                <?php } ?>
            </ul>
            <ul class="fly-panel fly-list fly-list-conter">
                <?php foreach ($questions as $row) { ?>
                    <li class="fly-list-li">
                        <a href="{:U('home/u/index',array('id'=>$row['uid']))}" class="fly-list-avatar">
                            <img src="__ROOT__/<?php echo $row['headface']; ?>" alt="<?php echo $row['username']; ?>">
                        </a>
                        <h2 class="fly-tip">
                            <a href="{:U('home/jie/index',array('id'=>$row['id']))}"><?php echo $row['title']; ?></a>
                        </h2>
                        <p>
                            <span>
                                <a href="{:U('home/u/index',array('id'=>$row['uid']))}"><?php echo $row['username']; ?></a>
                            </span>
                            <span>
                                <?php echo date('Y-m-d H:i:s',$row['create_time']); ?>
                            </span>
                            <span>
                                <?php echo $row['cname']; ?>
                            </span>
                            <span class="fly-list-hint">
                                <i class="iconfont" title="回答">
                                    
                                </i>
                                <?php echo $row['answer_num']; ?>
                                <i class="iconfont" title="人气">
                                    
                                </i>
                                <?php echo $row['view_num']; ?>
                            </span>
                        </p>
                    </li>
                <?php } ?>
            </ul>
            <div class="more"></div>
            <style type="text/css">
                .laypage-main {
                    border: 0px solid #000;
                }
                .laypage-main div{
                    border: 0px solid #000;
                }
                .laypage-main a{
                    border: 1px solid #009E94;
                    margin: 0px 5px;
                    color: #009E94;
                }
                .laypage-main span{
                    border: 1px solid #009E94;
                    margin: 0px 5px;
                    background: #009E94 url() 0 0 no-repeat;
                    color: #fff;
                }
            </style>
            <div style="text-align: center">
                <div class="laypage-main">
                    <!--<?php echo $page; ?>-->
                    
                </div>
            </div>
        </div>
    </div>
    <div class="edge">
        <div class="fly-panel leifeng-rank">
            <h3 class="fly-panel-title">
                近一月回答榜 - TOP 12
            </h3>
            <dl>
                <?php foreach ($users as $row) {  ?>
                    <dd>
                        <a href="{:U('home/u/index',array('id'=>$row['id']))}">
                            <img src="__ROOT__/<?php echo $row['headface']; ?>">
                            <cite>
                                <?php echo $row['username']; ?>
                            </cite>
                            <i>
                                <?php echo $row['answer_num']; ?>次回答
                            </i>
                        </a>
                    </dd>
                <?php } ?>
            </dl>
        </div>
        <dl class="fly-panel fly-list-one">
            <dt class="fly-panel-title">
                最近热帖
            </dt>
            <?php foreach ($hotView as $row) { ?>
                <dd>
                    <a href="<?php echo U('home/jie/index',array('id'=>$row['id'])) ?>">
                        <?php echo $row['title']; ?>
                    </a>
                    <span>
                        <i class="iconfont">
                            
                        </i>
                        <?php echo $row['view_num']; ?>
                    </span>
                </dd>
            <?php } ?>
        </dl>
        <dl class="fly-panel fly-list-one">
            <dt class="fly-panel-title">
                近期热议
            </dt>
            <?php foreach ($hotQuestion as $row) { ?>
                <dd>
                    <a href="<?php echo U('home/jie/index',array('id'=>$row['id'])) ?>">
                        <?php echo $row['title']; ?>
                    </a>
                    <span>
                        <i class="iconfont">
                            
                        </i>
                        <?php echo $row['answer_num']; ?>
                    </span>
                </dd>
            <?php } ?>
        </dl>
        <div class="fly-panel fly-link">
            <h3 class="fly-panel-title">
                友情链接
            </h3>
            <dl>
                <dd>
                    <a href="http://layim.layui.com/" target="_blank">
                        LayIM
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://layer.layui.com/" target="_blank">
                        layer
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.ttlutuan.com" target="_blank">
                        天天撸团
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.hotcn.top/" target="_blank">
                        国际热点
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.bejson.com/" target="_blank">
                        JSON在线工具
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.smeoa.com/" target="_blank">
                        小微OA
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.hibug.cn/" target="_blank">
                        在线Bug管理
                    </a>
                </dd>
                <dd>
                </dd>
                <dd>
                    <a href="http://www.houchaowei.com/" target="_blank">
                        MonkeyBlog
                    </a>
                </dd>
                <dd>
                </dd>
                <em class="hide start" value="<?php echo $_SEEION['start'] ?>"></em>
            </dl>
        </div>
    </div>
</div>
<style type="text/css">
     .more{
          width: 100px;
          height: 100px;
          background: red url() 0 0 no-repeat;
            }
</style>
<script>
layui.use(['form','jquery'], function(){
  var form = layui.form();
  $ = layui.jquery;
  
  
 
   start=-4;
  $('.more').click(function(event) {

        start +=5;
        $.ajax({
            url: '{:U('home/index/page')}',
            type: 'POST',
            dataType: 'json',
            data: {start: start},
        })
        .done(function(data) {
            if (data.info==1) {
                for (var i = 0; i <= data.conter.length-1; i++) {
                    $('.fly-list-conter').append('<li class="fly-list-li"><a href="'+'/Last_gua/bbs/index.php/home/jie/index/id/'+data.conter[i].id+'.html'+'"class="fly-list-avatar"><img src="/Last_gua/bbs/'+data.conter[i].headface+'"alt="'+data.conter[i].username+'"></a><h2 class="fly-tip"><a href="'+'/Last_gua/bbs/index.php/home/jie/index/id/'+data.conter[i].id+'.html'+'/'+'">'+data.conter[i].title+'</a></h2><p><span><a href="'+'/'+'">'+data.conter[i].username+'</a></span><span>'+data.conter[i].create_time+'</span><span>'+data.conter[i].cname+'</span><span class="fly-list-hint"><i class="iconfont"title="回答"></i>'+data.conter[i].answer_num+'<i class="iconfont"title="人气"></i>'+data.conter[i].aview_num+'</span></p></li>');
                };
            }else{
                layer.msg('没有更多啦！', function(){});
            };
        })
        .fail(function() {
            console.log("error");
        })
        
    });
});
</script>